import redis

pool = redis.ConnectionPool(host='localhost', port=6379, db=1)
def get_cache(use_pool=False):
    if use_pool:
        return redis.Redis(connection_pool=pool)
    return redis.Redis(host='localhost', port=6379, db=1)

